/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.gov.igac.observatorio.entidades.idea;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author bigbang
 */
@Entity
@Table(name = "nivelformacion")
@NamedQueries({
    @NamedQuery(name = "Nivelformacion.findAll", query = "SELECT n FROM Nivelformacion n"),
    @NamedQuery(name = "Nivelformacion.findByIdNivelFormacion", query = "SELECT n FROM Nivelformacion n WHERE n.idNivelFormacion = :idNivelFormacion"),
    @NamedQuery(name = "Nivelformacion.findByNombre", query = "SELECT n FROM Nivelformacion n WHERE n.nombre = :nombre")})
public class Nivelformacion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "idNivelFormacion")
    private Integer idNivelFormacion;
    @Size(max = 45)
    @Column(name = "nombre")
    private String nombre;
    @OneToMany(mappedBy = "nivelformacion")
    private List<Investigador> investigadorList;

    public Nivelformacion() {
    }

    public Nivelformacion(Integer idNivelFormacion) {
        this.idNivelFormacion = idNivelFormacion;
    }

    public Integer getIdNivelFormacion() {
        return idNivelFormacion;
    }

    public void setIdNivelFormacion(Integer idNivelFormacion) {
        this.idNivelFormacion = idNivelFormacion;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public List<Investigador> getInvestigadorList() {
        return investigadorList;
    }

    public void setInvestigadorList(List<Investigador> investigadorList) {
        this.investigadorList = investigadorList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idNivelFormacion != null ? idNivelFormacion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Nivelformacion)) {
            return false;
        }
        Nivelformacion other = (Nivelformacion) object;
        if ((this.idNivelFormacion == null && other.idNivelFormacion != null) || (this.idNivelFormacion != null && !this.idNivelFormacion.equals(other.idNivelFormacion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return this.nombre;
    }
    
}
